package com.utooo.controller;


import com.utooo.constant.ResultCodeConstant;
import com.utooo.pojo.domain.system.CategoryDO;
import com.utooo.pojo.domain.system.ProductSpecAttributeValueDO;
import com.utooo.pojo.dto.common.CreateGroup;
import com.utooo.pojo.dto.common.RestResult;
import com.utooo.pojo.dto.system.inparam.AttributeValueQueryDto;
import com.utooo.pojo.dto.system.inparam.CategoryCodeDto;
import com.utooo.service.system.CategoryService;
import com.utooo.service.system.ProductSpecAttributeValueService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description: TODO
 * @Author SJD
 * @Date: 2025/5/9 13:38
 * @Copyright: 南京优通信息科技股份有限公司
 */
@Tag(name = "系统管理-品类管理")
@RequestMapping("productspec/attributevalue")
@RestController
@RequiredArgsConstructor
public class ProductSpecAttributeValueController {

    private final ProductSpecAttributeValueService attributeValueServiceImpl;
    @RequestMapping(value = "/getAttributeValueByTypeCode", method = RequestMethod.POST)
    @Operation(summary = "新增品类时候获取品类code")
    @ResponseBody
    public RestResult<List<ProductSpecAttributeValueDO>> getAttributeValueByTypeCode(@RequestBody @Validated(CreateGroup.class) AttributeValueQueryDto param) {
        List<ProductSpecAttributeValueDO> result = attributeValueServiceImpl.getAttributeValueByTypeCode(param);
        return new RestResult<>(ResultCodeConstant.CODE_200, ResultCodeConstant.CODE_200_MSG, result);
    }

}
